package com.fy.market.trigger.feign;

import com.fy.market.types.common.reslut.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 策略抽奖Feign客户端
 * @author fwq
 * @date 2025-10-11
 */
@FeignClient(name = "fy-market-ddd", path = "/raffle")
public interface StrategyRaffleFeignClient {

    /**
     * 抽奖
     * @param userId 用户ID
     * @param strategyId 策略ID
     * @return 抽奖结果
     */
    @GetMapping("/doRaffle")
    R doRaffle(@RequestParam("userId") Integer userId, @RequestParam("strategyId") Integer strategyId);

    /**
     * 模拟扣减库存
     * @param strategyId 策略ID
     * @param awardId 奖品ID
     * @return 扣减库存结果
     */
    @GetMapping("/decrAwardStock")
    R decrAwardStock(@RequestParam("strategyId") Integer strategyId, @RequestParam("awardId") Integer awardId);

    /**
     * 添加用户接口
     * @return 用户信息
     */
    @GetMapping("/addUser")
    R addUser();

    /**
     * 查询用户信息
     * @param account 用户账号
     * @return 用户信息
     */
    @GetMapping("/getUser")
    R getUser(@RequestParam("account") String account);
}
